#encoding:utf-8
import urllib.request
import urllib.parse
url = "https://www.baidu.com/s?wd=nba&username=kangbazi#1"

result1 = urllib.parse.urlparse(url)
result2 = urllib.parse.urlsplit(url)

# print(result1)
# print(result2)

print('scheme:',result1.scheme)
print('netloc:',result1.netloc)
print('path:',result1.path)
print('params:',result1.params)
print('query:',result1.query)
print('fragment:',result1.fragment)